home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / TIME.PAK / TIMECTL.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  2KB  |  97 lines

  1. // timectl.h : Declaration of the CTimeCtrl OLE control class.
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1995 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13.  
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // Numeric constants
  17.  
  18. const DEFAULT_INTERVAL  = 1000;
  19.  
  20.  
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CTimeCtrl : See timectl.cpp for implementation.
  23.  
  24. class CTimeCtrl : public COleControl
  25. {
  26.     DECLARE_DYNCREATE(CTimeCtrl)
  27.  
  28. // Constructor
  29. public:
  30.     CTimeCtrl();
  31.  
  32. // Overrides
  33.  
  34.     // Drawing function
  35.     virtual void OnDraw(
  36.                 CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
  37.  
  38.     // Persistence
  39.     virtual void DoPropExchange(CPropExchange* pPX);
  40.  
  41.     // Reset control state
  42.     virtual void OnResetState();
  43.  
  44.     virtual void OnAmbientPropertyChange(DISPID dispid);
  45.  
  46.     virtual void OnEnabledChanged();
  47.  
  48. // Implementation
  49. protected:
  50.     ~CTimeCtrl();
  51.  
  52.     DECLARE_OLECREATE_EX(CTimeCtrl) // Class factory and guid
  53.     DECLARE_OLETYPELIB(CTimeCtrl)       // GetTypeInfo
  54.     DECLARE_PROPPAGEIDS(CTimeCtrl)      // Property page IDs
  55.     DECLARE_OLECTLTYPE(CTimeCtrl)        // Type name and misc status
  56.  
  57. // Message maps
  58.     //{{AFX_MSG(CTimeCtrl)
  59.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  60.     afx_msg void OnDestroy();
  61.     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  62.     afx_msg void OnTimer(UINT nIDEvent);
  63.     //}}AFX_MSG
  64.     DECLARE_MESSAGE_MAP()
  65.  
  66. // Dispatch maps
  67.     //{{AFX_DISPATCH(CTimeCtrl)
  68.     short m_interval;
  69.     afx_msg void OnIntervalChanged();
  70.     //}}AFX_DISPATCH
  71.     DECLARE_DISPATCH_MAP()
  72.  
  73.     afx_msg void AboutBox();
  74.  
  75. // Event maps
  76.     //{{AFX_EVENT(CTimeCtrl)
  77.     void FireTimer()
  78.         {FireEvent(eventidTimer,EVENT_PARAM(VTS_NONE));}
  79.     //}}AFX_EVENT
  80.     DECLARE_EVENT_MAP()
  81.  
  82. // Dispatch and event IDs
  83. public:
  84.     enum {
  85.     //{{AFX_DISP_ID(CTimeCtrl)
  86.     dispidInterval = 1L,
  87.     eventidTimer = 1L,
  88.     //}}AFX_DISP_ID
  89.     };
  90.  
  91. protected:
  92.  
  93.     void OnSetClientSite();
  94.     void StartTimer();
  95.     void StopTimer();
  96. };
  97.